package com.rd.student.dashuju.sunwenzhuo.day0731;

import java.util.ArrayList;

public class Test3 {
    public static void main(String[] args) {
        ArrayList list = new ArrayList();
        for (int i = 0; i < 50; i++) {
            list.add(i);
        }
        for (int i = 0; i < 20; i++) {
            int random = (int) (Math.random() * list.size());
            System.out.println("随机并移除" + list.get(random));
            list.remove(random);
        }

        System.out.println(list);
    }
}
